import http from './http.js'

let cs = '/api/admin';  // 线上服务 '/api/admin'  //本地服务 '/api' 

export const AnimalsPage = (params) => {
    return http.post(cs + '/animalsResource/getAnimalsPage', params)
}

export const fungusResource = (params) => {
    return http.post(cs + '/fungusResource/page', params)
}

export const PlantsPage = (params) => {
    return http.post(cs + '/plantsResource/getPlantsPage', params)
}

export const AnimalsInfo = (id) => {
    return http.get(cs + '/animalsResource/getAnimalsInfo?id=' + id)
}

export const PlantsInfo = (id) => {
    return http.get(cs + '/plantsResource/getPlantsInfo?id=' + id)
}

export const formInfo = (params) => {
    return http.get(cs + '/survey/formInfo' + params)
}

export const flSurvey = (type, params) => {
    return http.get(cs + `/${type}/page` + params)
}

export const exportSurvey = (params) => {
    return http.get(cs + `/export/survey` + params)
}

export const exportPages = (params) => {
    return http.get(cs + `/export/page` + params)
}

export const treespage = (areaId, level, keywords, pageNum, pageSize) => {
    return http.get(cs + '/treesResource/page', {
        areaId: areaId,
        level: level,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}
export const naturalpage = (areaId, keywords, pageNum, pageSize) => {
    return http.get(cs + '/naturalResource/page', {
        areaId: areaId,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}

export const treeInfo = (id) => {
    return http.get(cs + '/treesResource/treeInfo?id=' + id)
}

export const naturalInfo = (id) => {
    return http.get(cs + '/naturalResource/naturalInfo?id=' + id)
}

export const fungusInfo = (id) => {
    return http.get(cs + '/fungusResource/fungusInfo?id=' + id)
}

export const animalsSurveypage = (areaId, date, keywords, pageNum, pageSize) => {
    return http.get(cs + '/animalsSurvey/page', {
        areaId: areaId,
        date: date,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}

export const surveyInfo = (type, id) => {
    return http.get(cs + `/${type}/surveyInfo?id=` + id)
}

export const plantsSurveypage = (areaId, date, keywords, pageNum, pageSize) => {
    return http.get(cs + '/plantsSurvey/page', {
        areaId: areaId,
        date: date,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}

export const plantsSurveyInfo = (id) => {
    return http.get(cs + '/plantsSurvey/surveyInfo?id=' + id)
}


export const fungusSurvey = (areaId, date, keywords, pageNum, pageSize) => {
    return http.get(cs + '/fungusSurvey/page', {
        areaId: areaId,
        date: date,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}

export const fungusSurveyInfo = (id) => {
    return http.get(cs + '/fungusSurvey/surveyInfo?id=' + id)
}


export const treesSurvey = (areaId, date, keywords, pageNum, pageSize) => {
    return http.get(cs + '/treesSurvey/page', {
        areaId: areaId,
        date: date,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}

export const treesSurveyInfo = (id) => {
    return http.get(cs + '/treesSurvey/surveyInfo?id=' + id)
}

export const naturalSurvey = (areaId, date, keywords, pageNum, pageSize) => {
    return http.get(cs + '/naturalSurvey/page', {
        areaId: areaId,
        date: date,
        keywords: keywords,
        pageNum: pageNum,
        pageSize: pageSize
    })
}

export const naturalSurveyInfo = (id) => {
    return http.get(cs + '/naturalSurvey/surveyInfo?id=' + id)
}


export const BaseData = (type, areaId, men, gang, mu, ke, shu, level) => {
    return http.post(cs + '/animalsResource/getBaseData', {
        type: type,
        areaId: areaId,
        men: men,
        gang: gang,
        mu: mu,
        ke: ke,
        shu: shu,
        level: level
    })
}


export const animediaAll = (pamams) => {
    return http.post(cs + '/resource/media/page', pamams)
}

export const aniexport = (pamams) => {
    return http.down(cs + '/animalsResource/export', pamams)
}

export const plantexport = (pamams) => {
    return http.down(cs + '/plantsResource/export', pamams)
}

export const fungusexport = (pamams) => {
    return http.down(cs + '/fungusResource/export', pamams)
}

export const treesexport = (pamams) => {
    return http.down(cs + '/treesResource/export', pamams)
}

export const naturalResourceexport = (pamams) => {
    return http.down(cs + '/naturalResource/export', pamams)
}

export const anvocalAll = (id) => {
    return http.get(cs + '/animalsResource/vocalAll?resourceId=' + id)
}

export const plmediaAll = (id) => {
    return http.get(cs + '/plantsResource/mediaAll?resourceId=' + id)
}

export const fungusmediaAll = (id) => {
    return http.get(cs + '/fungusResource/mediaAll?resourceId=' + id)
}

export const treesmediaAll = (id) => {
    return http.get(cs + '/treesResource/mediaAll?resourceId=' + id)
}

export const naturalmediaAll = (id) => {
    return http.get(cs + '/naturalResource/mediaAll?resourceId=' + id)
}

export const token = (token) => {
    return http.get(cs + '/token?token=' + token)
}

export const typeCount = (areaId) => {
    return http.get(cs + '/dataIdentify/typeCount?areaId=' + areaId)
}

export const ipage = (pageSize, pageNum, areaId, startTime, endTime, surveyType, specieType, resourceType, workerNameStr, identifyStatusStr, keyWords) => {
    return http.get(cs + '/dataIdentify/dataPage', {
        pageSize: pageSize,
        pageNum: pageNum,
        areaId: areaId,
        startTime: startTime,
        endTime: endTime,
        surveyType: surveyType,
        specieType: specieType,
        workerNameStr: workerNameStr,
        identifyStatusStr: identifyStatusStr,
        keyWords: keyWords
    })
}
// 
export const workers = (params) => {
    return http.get(cs + "/dataIdentify/userItems", params)
}

export const ifd = (params) => {
    return http.post(cs + "/dataIdentify/identifyData", params)
}

export const uploadByResource = (params) => {
    return http.post(cs + "/resource/uploadByResource", params)
}

export const specieNameList = (params) => {
    return http.get(cs + "/dataIdentify/specieNameList", params)
}

export const specieDetail = (params) => {
    return http.get(cs + "/dataIdentify/specieDetail", params)
}

export const delmi = (id) => {
    return http.del(cs + "/dataIdentify/deleteMedia?mediaId=" + id)
}

export const delbeautiful = (id) => {
    return http.del(cs + "/resource/beautiful/delete/" + id)
}

export const exportDeletes = (id) => {
    return http.del(cs + "/export/delete/" + id)
}

export const mediaEdit = (params) => {
    return http.post(cs + "/resource/media/edit", params)
}

export const mediaCourse = (params) => {
    return http.post(cs + "/resource/media/course", params)
}

export const mediaDelete = (id) => {
    return http.del(cs + "/resource/media/delete", id)
}

export const quadratExportDelete = (id) => {
    return http.del(cs + "/quadrat/export/delete/" + id)
}

export const mediaexportDelete = (id) => {
    return http.del(cs + "/resource/media/export/delete/" + id)
}

export const resourceDelete = (params) => {
    return http.del(cs + "/resource/delete", params)
}

export const quadratDelete = (params) => {
    return http.del(cs + "/quadrat/delete", params)
}

export const surveyDelete = (params) => {
    return http.del(cs + "/survey/delete", params)
}

export const area = (params) => {
    return http.get(cs + "/area/" + params)
}

export const layerInfo = (params) => {
    return http.get(cs + "/specialLayer/layerInfo", params)
}

export const overview = (params) => {
    return http.get(cs + "/resStatistics/overview" + params)
}

export const formatData = (params) => {
    return http.get(cs + "/patrolData/formatData?dataId=" + params)
}

// ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓  统计分析
export const dataCount = (params) => {
    return http.get(cs + "/resAllStatistics/dataCount" + params)
}

export const locationMedia = (params) => {
    return http.get(cs + "/animalsResource/getLocationMedia" + params)
}

export const Grids = (params) => {
    return http.get(cs + "/resAllStatistics/getGrids?areaId=" + params)
}

export const speciesStatistics = (params) => {
    return http.get(cs + "/resAllStatistics/speciesStatistics" + params)
}

export const Gnqh = (params) => {
    return http.get(cs + "/resAllStatistics/getGnqh?areaId=" + params)
}

export const GridsData = (params) => {
    return http.get(cs + "/resAllStatistics/getGridsData" + params)
}

export const areaData = (params) => {
    return http.get(cs + "/resAllStatistics/getAreaData" + params)
}

export const loaltionData = (params) => {
    return http.get(cs + "/resAllStatistics/getLoaltionData" + params)
}

export const GridsMediaPage = (params) => {
    return http.get(cs + "/resAllStatistics/getGridsMediaPage" + params)
}

export const areaMediaPage = (params) => {
    return http.get(cs + "/resAllStatistics/getAreaMediaPage" + params)
}

export const locationMediaPage = (params) => {
    return http.get(cs + "/resAllStatistics/getLocationMediaPage" + params)
}

export const getsp2000 = (params) => {
    return http.get(cs + "/sp2000/getOne?keywords=" + params)
}

export const isExist = (params) => {
    return http.get(cs + "/resource/isExist" + params)
}

export const resourcePoint = (params) => {
    return http.get(cs + "/resource/point/" + params)
}

export const wangges = (params) => {
    return http.get(cs + "/layer/wangges?areaId=" + params)
}

export const xiaoban = (params) => {
    return http.get(cs + "/layer/xiaoban?areaId=" + params)
}

export const statistics = (params) => {
    return http.post(cs + "/resource/statistics", params)
}

export const exportPage = (params) => {
    return http.get(cs + "/resource/media/export/page" + params)
}

export const quadratPage = (params) => {
    return http.get(cs + "/quadrat/page" + params)
}

export const quadratExport = (params) => {
    return http.get(cs + "/quadrat/export/page?pageNum=1&pageSize=9999")
}

export const qExport = (params) => {
    return http.get(cs + "/quadrat/export" + params)
}

export const workerInfo = (params) => {
    return http.get(cs + "/patrolMonitor/workerInfo" + params)
}

export const siteInfo = (params) => {
    return http.get(cs + "/patrolMonitor/siteInfo" + params)
}

export const uploadResourceStatistics = (params) => {
    return http.get(cs + "/uploadResource/statistics?areaId=" + params)
}

export const resourceLevelCity = (params) => {
    return http.get(cs + "/resource/levelCity" + params)
}

export const mediaExport = (params) => {
    return http.post(cs + "/resource/media/export", params)
}

export const addresource = (params) => {
    return http.post(cs + "/resource/add", params)
}

export const editresource = (params) => {
    return http.post(cs + "/resource/edit", params)
}

export const demosearch = (page, size, params) => {
    return http.post(cs + `/device/search?page=${page}&size=${size}`, params)
}

export const quadratDetails = (params) => {
    return http.post(cs + `/quadrat/detail`, params)
}

export const updateForm = (params) => {
    return http.post(cs + `/animalsSurvey/updateForm`, params)
}

export const uploadResourcePage = (params) => {
    return http.post(cs + `/uploadResource/page`, params)
}

export const uploadResource = (params) => {
    return http.post(cs + `/uploadResource`, params)
}




